//
//  UIBarButtonItem+Extension.swift
//  WeiBoSwift
//
//  Created by admin on 2017/12/12.
//  Copyright © 2017年 admin. All rights reserved.
//

import Foundation
import UIKit

extension UIBarButtonItem {
    convenience init(imageName : String) {
        self.init()
        
        let button : UIButton = UIButton()
        button.setImage(UIImage.init(named: imageName), for: .normal)
        button.setImage(UIImage.init(named: imageName + "_highlighted"), for: .highlighted)
        button.sizeToFit()
        
        customView = button
    }
}
